package com.viettel.core.bussiness.report;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;

import com.viettel.core.dao.service.SmsServiceDAO;
import com.viettel.core.entities.service.SmsService;
import com.viettel.core.exceptions.BusinessException;
import com.viettel.core.exceptions.DataAccessException;

/**
 *  @author: HUYNHDC
 *  @version:  
 *  @since: 17/07/2014 - 10:50:59
 */
public class SmsServiceMgrImpl implements SmsServiceMgr {

	@Autowired 
	SmsServiceDAO smsServiceDAO; 
	
	@Override
	public SmsService getSmsServiceById(Integer id) throws BusinessException {
		try { 
			return  smsServiceDAO.getSmsServiceById(id); 
		} catch (DataAccessException e) { 
			throw new BusinessException(e); 
		} 
	}

	@Override
	public SmsService createSmsService(SmsService smsService)
			throws BusinessException {
		try { 
			return  smsServiceDAO.createSmsService(smsService); 
		} catch (DataAccessException e) { 
			throw new BusinessException(e); 
		} 
	}

	@Override
	public List<SmsService> getListSmsServiceByGroupId(Integer id)
			throws BusinessException {
		try { 
			return  smsServiceDAO.getListSmsServiceByGroupId(id); 
		} catch (DataAccessException e) { 
			throw new BusinessException(e); 
		} 
	}

	@Override
	public void updateSmsService(SmsService smsService)
			throws BusinessException {
		try { 
			smsServiceDAO.updateSmsService(smsService); 
		} catch (DataAccessException e) { 
			throw new BusinessException(e); 
		} 
	}

	@Override
	public void deleteSmsService(SmsService smsService)
			throws BusinessException {
		try { 
			smsServiceDAO.deleteSmsService(smsService); 
		} catch (DataAccessException e) { 
			throw new BusinessException(e); 
		} 
	}
	
	@Override
	public List<SmsService> getListSmsServiceByGroupIdAndType(Integer id, Integer typeId)
			throws BusinessException{
		try { 
			return smsServiceDAO.getListSmsServiceByGroupIdAndType(id, typeId); 
		} catch (DataAccessException e) { 
			throw new BusinessException(e); 
		} 
	}

}
